package com.ccc.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.ManyToOne;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;

/**
 * Line entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "line")
public class Line implements java.io.Serializable {

	// Fields

	private Integer lineId;
	private Product product;
	private String lineName;
	private Integer lineRentPrice;
	private Integer lineBuyPrice;
	private Integer lineCapacity;
	private Integer largePrice;
	private Integer largeCapacity;

	public Line(){}
	public Line(int id){
		this.lineId = id;
	}
	
	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "lineId", unique = true, nullable = false)
	public Integer getLineId() {
		return this.lineId;
	}

	public void setLineId(Integer lineId) {
		this.lineId = lineId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "productId",nullable = true,unique=true)
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Column(name = "lineName", nullable = true, length = 50)
	public String getLineName() {
		return this.lineName;
	}

	public void setLineName(String lineName) {
		this.lineName = lineName;
	}

	@Column(name = "lineRentPrice", nullable = true)
	public Integer getLineRentPrice() {
		return this.lineRentPrice;
	}

	public void setLineRentPrice(Integer lineRentPrice) {
		this.lineRentPrice = lineRentPrice;
	}

	@Column(name = "lineBuyPrice", nullable = true)
	public Integer getLineBuyPrice() {
		return this.lineBuyPrice;
	}

	public void setLineBuyPrice(Integer lineBuyPrice) {
		this.lineBuyPrice = lineBuyPrice;
	}

	@Column(name = "lineCapacity", nullable = true)
	public Integer getLineCapacity() {
		return this.lineCapacity;
	}

	public void setLineCapacity(Integer lineCapacity) {
		this.lineCapacity = lineCapacity;
	}

	@Column(name = "largePrice", nullable = true)
	public Integer getLargePrice() {
		return this.largePrice;
	}

	public void setLargePrice(Integer largePrice) {
		this.largePrice = largePrice;
	}

	@Column(name = "largeCapacity", nullable = true)
	public Integer getLargeCapacity() {
		return this.largeCapacity;
	}

	public void setLargeCapacity(Integer largeCapacity) {
		this.largeCapacity = largeCapacity;
	}

}